# -*- coding: utf-8 -*-
"""
Created on Sun Sep 10 19:40:07 2023

@author: 楠川之木
"""
x=eval(input("请输入一个x:"))
if x<0 or x>=20:
    y=0
elif 0<x<5:
    y=x
elif 5<x<10:
    y=3*x-5
else:
    y=0.5*x-2
print(y)
